package com.ap.generator.rtp;

import com.ap.core.cxf.jaxb.common.DeliveryType;
import com.ap.core.cxf.jaxb.rtp.AbstractDeliveryInfoTypeGeneratorBuilder;
import com.ap.datagen.core.GeneratorHelper;
import com.ap.generator.common.AddressCountryCodeGeneratorBuilder;

import static com.ap.datagen.core.GeneratorHelper.*;
import static com.ap.datagen.core.Nullable.nullable;

public class DeliveryInfoTypeGeneratorBuilder extends
		AbstractDeliveryInfoTypeGeneratorBuilder {

	@Override
	public void setupDefaults() {
		this.deliveryTypeGenerator = nullable(randomGeneratorFromEnum(DeliveryType.DIGDEL));
		this.emailAddressGenerator = nullable(GeneratorHelper.fixedValueGenerator("noreply@ap.com"));
	}

	public static DeliveryInfoTypeGeneratorBuilder getDeliveryInfoTypeGenerator() {
		return new DeliveryInfoTypeGeneratorBuilder();
	}
	
	/**
	 * 
	 * @param value
	 * @return
	 */
	public DeliveryInfoTypeGeneratorBuilder withDeliveryType(DeliveryType value) {
        this.deliveryTypeGenerator = nullable(fixedValueGenerator(value));
        return this;
    }
	
	/**
	 * 
	 * @return
	 */
	public DeliveryInfoTypeGeneratorBuilder withDeliveryAddress() {
		 this.deliveryAddressGenerator = nullable(buildA(AddressCountryCodeGeneratorBuilder.getAddressCountryCodeGenerator()));
        return this;
    }
	 
}
